from fastapi import FastAPI
from pydantic import BaseModel

import uvicorn

class Item(BaseModel):
    name: str
    description: str | None = None
    price: float


app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}

@app.post("/items/")
async def create_item(item: Item):
    item_dict = item.model_dump()
    return item_dict

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8888)
